<div class="open-form">
    <div class="open-model">
        <div class="open-auto">
            <button class="layui-btn" id="isCheckFun" style="border-radius: 4px;margin-bottom: 10px">确认选择</button>
            <table id="warehouseProductVarietyForm"></table>
        </div>
        <div class="layui-form-item text-right">
            <button class="layui-btn layui-btn-primary" type="button" ew-event="closeDialog">关闭</button>
        </div>
    </div>
</div>
<script>
    layui.use(['layer', 'form', 'table', 'admin', 'upload', 'tree', 'laytpl'], async function () {
        var $ = layui.jquery;
        var layer = layui.layer;
        var form = layui.form;
        var table = layui.table;
        var config = layui.config;
        const nowData = {...parentData}
        let cacheList = nowData.cacheList
        table.render({
            elem: '#warehouseProductVarietyForm',
            url: config.base + `warehouse/warehouse/productVariety/list`,
            where: {notInListIds: nowData.notInListIds},
            page: true,
            cellMinWidth: 100,
            cols: [[
                {field: 'varietyCode', align: 'center', title: '编码', width: 150}
                , {field: 'varietyName', align: 'center', title: '名称', width: 150}
                , {field: 'remark', align: 'center', title: '备注'}
                // , {field: 'creatorName', align: 'center', title: '创建人', width: 140}
                , {field: 'createTime', align: 'center', title: '创建时间', width: 180}
                , {align: 'center', toolbar: '#warehouseTableBar', title: '操作', width: 150, fixed: 'right'}
            ]],
        });
        $('#isCheckFun').click(() => {
            var checkStatus = table.checkStatus('warehouseProductVarietyForm');

            var data = checkStatus.data;  // 选中的数据
            if (typeof parent.layui !== 'undefined') {
                childData.list = data.map(v => {
                    v.productDetailId = v.id;
                    v.warehousePrice = 1.03;
                    delete v.id
                    return v
                })
                console.log('childData', data)
                layer.close(parentData.zindex); // 关闭指定的弹窗
            }
        })

    })
</script>